<@t.html>
	<@t.container title="添加消息模板" icon="file-archive-o" back="true" >
				<@t.form id="add_form">
					<#if bean??>
        				<input type="hidden" id="id" name="id" value="${bean.id}"/>	
					</#if>
                	<@t.text title="标题" id="title" value="${bean.title!''}" />
                	<@t.text title="缩写" id="slug" value="${bean.slug!''}" />
                	<@t.editor title="内容" id="content" value="${bean.content!''}" />
                	<@t.textarea title="说明" id="mintext" value="${bean.mintext!''}" />
					<@t.submitBtn title="提交"/>
               </@t.form>
	</@t.container>
	<script type="text/javascript" src="public/common/ueditor/ueditor.config.js"></script>
	<script type="text/javascript" src="public/common/ueditor/ueditor.all.min.js"></script>
	<script type="text/javascript">
     $(function(){
		//提交表单
       	  $('#add_form').validator({
        		theme: 'yellow_right_effect',  //设置theme
        		stopOnError: true, //
        		showOk:false,
        	    fields: {
        	        "title": {
        	            rule: "required;",
        	            ok: "",
        	            tip:"请填写名称",
        	            msg: {
        	            	required: "名称不可以为空!",
        	            }
        	        }
        	    }
        	});
		  $('#add_form').on('valid.form', function(e, form){
		  	   //成功之后刷新gd，关闭自己
			   var data=$(this).serialize();
				//提交表单
               $ .axsf('admin/templates/add',data,function(d){
			   		if(d){
                         if(d.code==200){
							window.location.href="admin/templates/index";
                         }else{
						 	alert(d.message);
						 }
                	}
			   });
        });
});
    </script>
</@t.html>